import request from '@/utils/request'

export function gettypeListApi(data) {
  return request({
    url: '/newsType/pageInfo',
    method: 'post',
    data
  })
}

export function saveTypeApi(data) {
  return request({
    url: '/newsType/save',
    method: 'post',
    data
  })
}

export function changeTypeStateApi(data) {
  return request({
    url: '/newsType/changeState',
    method: 'post',
    data
  })
}

export function getTypeDetailApi(data) {
  return request({
    url: `/newsType/detail/${data}`,
    method: 'post',
    data
  })
}

export function deleteTypeApi(data) {
  return request({
    url: '/newsType/batchDelete',
    method: 'post',
    data
  })
}

export function getListApi(data) {
  return request({
    url: '/news/pageInfo',
    method: 'post',
    data
  })
}

export function deleteApi(data) {
  return request({
    url: '/news/batchDelete',
    method: 'post',
    data
  })
}

export function saveApi(data) {
  return request({
    url: '/news/save',
    method: 'post',
    data
  })
}

export function getDetailApi(data) {
  return request({
    url: `/news/detail/${data}`,
    method: 'post',
    data
  })
}

export function changeStateApi(data) {
  return request({
    url: '/news/changeState',
    method: 'post',
    data
  })
}

export function changeTopApi(obj) {
  return request({
    url: `/news/setTop/${obj.id}/${obj.isShow}`,
    method: 'post',
  })
}
